package ioc;

import ioc.bean.HelloWorld;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class LifeTimeApp {
    public static void main(String[] args) {
        final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("ioc\\beans.xml");
        final HelloWorld myHelloWorld = (HelloWorld) context.getBean("helloworld3");
        myHelloWorld.setMessage("Hello World!");
        myHelloWorld.getMessage();
        context.registerShutdownHook();//bean销毁
    }
}
